<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>图表在线调试页面</title>
    <style>
        #app {
            display: flex;
            flex-direction: column
        }
        #app .title {
            text-align: center;
        }
        #app .ops {
            display: flex;
            gap: 16px;
        }
        #app  select,  #app  input, #app button, #app textarea {
            height: 36px;
            box-sizing: border-box;
            border: 1px solid #ccc;
            border-radius: 4px;
            outline: none;
            padding: 0 10px;
            background: white;
        }

        #app .main {
            margin-top: 20px;
            display: flex;
            gap: 20px;
        }
        #app .main .left {
            width: 30%;
            display: flex;
            flex-direction: column;
            gap: 12px;
        }
        #app .main .left textarea {
            height: 500px;
        }
        #app .main .right {
            width: 100%;
            border-radius: 4px;
            box-sizing: border-box;
            border: 1px solid #ccc;
        }
    </style>
</head>


<body>
<div id="app">
    <h1 class="title">图表在线调试页面</h1>
    <div>
        <div class="ops">
            <label>类型:
                <select v-model="type">
                    <option value="pie">饼图</option>
                    <option value="bar">柱状图</option>
                    <option value="line">折线图</option>
                    <option value="china">中国地图</option>
                </select>
            </label>
            <label>宽度(px):
                <input type="number" v-model="width"/>
            </label>
            <label>宽度(px):
                <input type="number" v-model="height"/>
            </label>
            <button :disabled="loading" id="submit" @click="generateImg">生成图片</button>
            <br>
<!--            <a target="_blank" href="https://echarts.apache.org/zh/index.html"> 查看文档</a>-->
        </div>
        <div class="main">
            <div class="left">
                <button id="format" @click="formatJSON">JSON格式化</button>
                <textarea v-model="chartConfig"></textarea>
            </div>
            <div class="right">
                <img style="width: 100%" :src="imageBase64">
            </div>
        </div>
    </div>
</div>
<script src="/js/vue.global.js"></script>
<script src="/js/axios.min.js"></script>
<script src="/js/fmt2json.js"></script>
<script src="/js/charts.js"></script>
</body>

</html>
